/**
 * 
 */
package com.mes.check.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.context.annotation.Lazy;

import com.mes.basicdata.domain.Dept;
import com.mes.basicdata.domain.Employee;
import com.mes.basicdata.domain.OperationMeasurement;
import com.mes.common.domain.BasicModel;

/**
 * <p>
 * 报废单明细
 * </p>
 */
@Entity()
@Table(name = "M_REJECTDETAIL")
@BatchSize(size=20)
@Lazy(value=true)
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class RejectDetail extends BasicModel implements java.io.Serializable {

	@Id
	@GenericGenerator(name = "uniqueId", strategy = "assigned")
	@Column(name="UNIQUEID") 
	protected String uniqueId;
	
	@Column(name="SEQ")
	protected Integer seq;
	
	@Column(name="REJECTUID")
	protected String rejectUid;
	
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "REJECTUID", insertable = false, updatable = false)
	protected Reject reject;
	
	@Column(name="DEFECTDESC")
	protected String defectDesc;

	@Column(name="CHECKER")
	protected String checkerUid;
	
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHECKER", insertable = false, updatable = false)
	protected Employee checker;

	@Column(name="DUTIER")
	protected String dutierUid;
	
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DUTIER", insertable = false, updatable = false)
	protected Employee dutier;

	@Column(name="DUTYDEPTDELEGATE")
	protected String dutyDeptDelegateUid;
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DUTYDEPTDELEGATE", insertable = false, updatable = false)
	protected Employee dutyDeptDelegate;
	
	@Column(name="DUTYDEPTID")
	protected String dutyDeptUid;
	
	@ForeignKey(name = "null")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DUTYDEPTID", insertable = false, updatable = false)
	protected Dept dutyDept;
	
	@Column(name="CHECKTIME")
	protected Date checkTime;

	@Column(name="MATERIALSNS")
	protected String materialSns;
	
	@Column(name="MATERIALUSN")
	protected String materialUid;
	
	@Column(name="REJECTQTY")
	protected Float rejectQty;
	
	@Column(name="DEFECTREASON")
	protected String defectReason;

//	@Column(name="MEASUREMENTUID")
//	protected String measurementUid;
//	
//	@ForeignKey(name = "null")
//	@ManyToOne(fetch = FetchType.LAZY)
//	@JoinColumn(name = "MEASUREMENTUID", insertable = false, updatable = false)
//	protected OperationMeasurement operationMeasurement;


	public RejectDetail() {
	}

	/**
	 * 获取序列号。
	 * 
	 * @return the seq
	 */

	public Integer getSeq() {
		return seq;
	}

	/**
	 * 设置序列号。
	 * 
	 * @param seq
	 *            the seq to set
	 */
	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	/**
	 * 获取报废品表编号。
	 * 
	 * @return the rejectUid
	 */

	public String getRejectUid() {
		return rejectUid;
	}

	/**
	 * 设置报废品表编号。
	 * 
	 * @param rejectUid
	 *            the rejectUid to set
	 */
	public void setRejectUid(String rejectUid) {
		this.rejectUid = rejectUid;
	}

	/**
	 * 获取报废表头。
	 * 
	 * @return the Reject
	 */

	public Reject getReject() {
		return reject;
	}

	/**
	 * 设置报废表头。
	 * 
	 * @param Reject
	 *            the Reject to set
	 */
	public void setReject(Reject reject) {
		this.reject = reject;
	}

	/**
	 * 获取缺陷描述。
	 * 
	 * @return the defectDesc
	 */

	public String getDefectDesc() {
		return defectDesc;
	}

	/**
	 * 设置缺陷描述。
	 * 
	 * @param defectDesc
	 *            the defectDesc to set
	 */
	public void setDefectDesc(String defectDesc) {
		this.defectDesc = defectDesc;
	}

	/**
	 * 获取检验员编号。
	 * 
	 * @return the checkerUid
	 */

	public String getCheckerUid() {
		return checkerUid;
	}

	/**
	 * 设置检验员编号。
	 * 
	 * @param checkerUid
	 *            the checkerUid to set
	 */
	public void setCheckerUid(String checkerUid) {
		this.checkerUid = checkerUid;
	}

	/**
	 * 获取检验员。
	 * 
	 * @return the checker
	 */

	public Employee getChecker() {
		return checker;
	}

	/**
	 * 设置检验员。
	 * 
	 * @param checker
	 *            the checker to set
	 */
	public void setChecker(Employee checker) {
		this.checker = checker;
	}

	/**
	 * 获取检验时间。
	 * 
	 * @return the checkTime
	 */

	public Date getCheckTime() {
		return checkTime;
	}

	/**
	 * 设置检验时间。
	 * 
	 * @param checkTime
	 *            the checkTime to set
	 */
	public void setCheckTime(Date checkTime) {
		this.checkTime = checkTime;
	}

	/**
	 * 获取物料序列号。
	 * 
	 * @return the materialSns
	 */

	public String getMaterialSns() {
		return materialSns;
	}

	/**
	 * 设置物料序列号。
	 * 
	 * @param materialSns
	 *            the materialSns to set
	 */
	public void setMaterialSns(String materialSns) {
		this.materialSns = materialSns;
	}

	/**
	 * 获取报废品数量。
	 * 
	 * @return the rejectQty
	 */

	public Float getRejectQty() {
		return rejectQty;
	}

	/**
	 * 设置报废品数量。
	 * 
	 * @param rejectQty
	 *            the rejectQty to set
	 */
	public void setRejectQty(Float rejectQty) {
		this.rejectQty = rejectQty;
	}

	/**
	 * 获取创建者。
	 * 
	 * @return the creator
	 */

	public Employee getCreator() {
		return creator;
	}

	/**
	 * 设置创建者。
	 * 
	 * @param creator
	 *            the creator to set
	 */
	public void setCreator(Employee creator) {
		this.creator = creator;
	}

	/**
	 * @return the dutierUid
	 */
	public String getDutierUid() {
		return dutierUid;
	}

	/**
	 * @param dutierUid
	 *            the dutierUid to set
	 */
	public void setDutierUid(String dutierUid) {
		this.dutierUid = dutierUid;
	}

	/**
	 * @return the dutier
	 */
	public Employee getDutier() {
		return dutier;
	}

	/**
	 * @param dutier
	 *            the dutier to set
	 */
	public void setDutier(Employee dutier) {
		this.dutier = dutier;
	}

	/**
	 * @return the dutyDeptDelegateUid
	 */
	public String getDutyDeptDelegateUid() {
		return dutyDeptDelegateUid;
	}

	/**
	 * @param dutyDeptDelegateUid
	 *            the dutyDeptDelegateUid to set
	 */
	public void setDutyDeptDelegateUid(String dutyDeptDelegateUid) {
		this.dutyDeptDelegateUid = dutyDeptDelegateUid;
	}

	/**
	 * @return the dutyDeptDelegate
	 */
	public Employee getDutyDeptDelegate() {
		return dutyDeptDelegate;
	}

	/**
	 * @param dutyDeptDelegate
	 *            the dutyDeptDelegate to set
	 */
	public void setDutyDeptDelegate(Employee dutyDeptDelegate) {
		this.dutyDeptDelegate = dutyDeptDelegate;
	}

	/**
	 * @return the dutyDeptUid
	 */
	public String getDutyDeptUid() {
		return dutyDeptUid;
	}

	/**
	 * @param dutyDeptUid
	 *            the dutyDeptUid to set
	 */
	public void setDutyDeptUid(String dutyDeptUid) {
		this.dutyDeptUid = dutyDeptUid;
	}

	/**
	 * @return the dutyDept
	 */
	public Dept getDutyDept() {
		return dutyDept;
	}

	/**
	 * @param dutyDept
	 *            the dutyDept to set
	 */
	public void setDutyDept(Dept dutyDept) {
		this.dutyDept = dutyDept;
	}

	/**
	 * @return the defectReason
	 */
	public String getDefectReason() {
		return defectReason;
	}

	/**
	 * @param defectReason
	 *            the defectReason to set
	 */
	public void setDefectReason(String defectReason) {
		this.defectReason = defectReason;
	}

	/**
	 * @return the materialUid
	 */
	public String getMaterialUid() {
		return materialUid;
	}

	/**
	 * @param materialUid
	 *            the materialUid to set
	 */
	public void setMaterialUid(String materialUid) {
		this.materialUid = materialUid;
	}

}
